home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
program
/
greed.zip
/
RSTRFNC.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-09-12
|
2KB
|
57 lines
/* REXX *********************************************/
/* */
/* Program name: RSTRFNC */
/* Function : Restore Backup after the failing */
/* installation */
/* example for the post-install- */
/* failure exit */
/* */
/* Syntax : Call from the INSTALL.DAT via: */
/* START_REXX_IF_FAILURE=RESTOREP dest_path */
/* */
/* Changes : */
/* */
/* Made use of GREED. 21 May 1996 / 21:22:36 JRK */
/****************************************************/
Parse Arg destPath
/*-------------(Write lines into file)--------------*/
filename = destPath'\install.log'
rc = LineOut( filename, 'Destination Directory:' destPath)
/*==============(Exception handling)================*/
Signal On Failure Name CLEARUP
Signal On Halt Name CLEARUP
Signal On Syntax Name CLEARUP
/*==========(Initialize RexxUtil support)===========*/
If RxFuncQuery('SysLoadFuncs') Then Do
Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
Call SysLoadFuncs
End /* If RxFuncQuery... */
/*--------------(Save directory)---------------*/
directory = destPath||'\SAVEPREV'
/*-----------(Find file/Set attributes)-------------*/
rc = SysFileTree( directory||'\*.fnc', fileList, 'FO' )
Do i = 1 To fileList.0
name = FileSpec( "Name", fileList.i ) /* FILENAME.EXT */
delRC = SysFileDelete( destPath'\'name )
a = "Delete: " destPath'\'name || ", RC="delRC
Queue Date( S ) Time() a
/*------------------(copy file)-------------------*/
"unpack" fileList.i destPath||"\"
/* If rc = 0 Then delRC = SysFileDelete( fileList.i ) */
a = "unpack" fileList.i destPath||"\" || ", RC="rc
Queue Date( S ) Time() 'Restore:' a
End /* If ... */
/*-------------(Remove directory)--------------*/
/* rc = SysRmDir( directory ) */
/*================(End this program)================*/
Return
CLEARUP:
Say 'GREED001E - Break, Failure or Syntax Error'
Return